3.72 \(\int \frac{\csc ^3(e+f x)}{(a+b \tan ^2(e+f x))^2} \, dx\)

Optimal. Leaf size=147 \[ -\frac{b \sec (e+f x)}{a^2 f \left (a+b \sec ^2(e+f x)-b\right )}-\frac{(a-4 b) \tanh ^{-1}(\cos (e+f x))}{2 a^3 f}-\frac{\sqrt{b} (3 a-4 b) \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{2 a^3 f \sqrt{a-b}}-\frac{\cot (e+f x) \csc (e+f x)}{2 a f \left (a+b \sec ^2(e+f x)-b\right )} \]

[Out]

-((3*a - 4*b)*Sqrt[b]*ArcTan[(Sqrt[b]*Sec[e + f*x])/Sqrt[a - b]])/(2*a^3*Sqrt[a - b]*f) - ((a - 4*b)*ArcTanh[C
os[e + f*x]])/(2*a^3*f) - (Cot[e + f*x]*Csc[e + f*x])/(2*a*f*(a - b + b*Sec[e + f*x]^2)) - (b*Sec[e + f*x])/(a
^2*f*(a - b + b*Sec[e + f*x]^2))

________________________________________________________________________________________

Rubi [A]  time = 0.181454, antiderivative size = 147, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.261, Rules used = {3664, 471, 527, 522, 207, 205} \[ -\frac{b \sec (e+f x)}{a^2 f \left (a+b \sec ^2(e+f x)-b\right )}-\frac{(a-4 b) \tanh ^{-1}(\cos (e+f x))}{2 a^3 f}-\frac{\sqrt{b} (3 a-4 b) \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{2 a^3 f \sqrt{a-b}}-\frac{\cot (e+f x) \csc (e+f x)}{2 a f \left (a+b \sec ^2(e+f x)-b\right )} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^3/(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-((3*a - 4*b)*Sqrt[b]*ArcTan[(Sqrt[b]*Sec[e + f*x])/Sqrt[a - b]])/(2*a^3*Sqrt[a - b]*f) - ((a - 4*b)*ArcTanh[C
os[e + f*x]])/(2*a^3*f) - (Cot[e + f*x]*Csc[e + f*x])/(2*a*f*(a - b + b*Sec[e + f*x]^2)) - (b*Sec[e + f*x])/(a
^2*f*(a - b + b*Sec[e + f*x]^2))

Rule 3664

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[((-1 + ff^2*x^2)^((m - 1)/2)*(a - b + b*ff^2*x^2)^p)/x^(
m + 1), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rule 471

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(e^(n -
1)*(e*x)^(m - n + 1)*(a + b*x^n)^(p + 1)*(c + d*x^n)^(q + 1))/(n*(b*c - a*d)*(p + 1)), x] - Dist[e^n/(n*(b*c -
 a*d)*(p + 1)), Int[(e*x)^(m - n)*(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[c*(m - n + 1) + d*(m + n*(p + q + 1)
+ 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[p, -1] && GeQ[n
, m - n + 1] && GtQ[m - n + 1, 0] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 527

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_.)*((e_) + (f_.)*(x_)^(n_)), x_Symbol] :> -Simp[
((b*e - a*f)*x*(a + b*x^n)^(p + 1)*(c + d*x^n)^(q + 1))/(a*n*(b*c - a*d)*(p + 1)), x] + Dist[1/(a*n*(b*c - a*d
)*(p + 1)), Int[(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[c*(b*e - a*f) + e*n*(b*c - a*d)*(p + 1) + d*(b*e - a*f)
*(n*(p + q + 2) + 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, f, n, q}, x] && LtQ[p, -1]

Rule 522

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\csc ^3(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^2}{\left (-1+x^2\right )^2 \left (a-b+b x^2\right )^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac{\cot (e+f x) \csc (e+f x)}{2 a f \left (a-b+b \sec ^2(e+f x)\right )}+\frac{\operatorname{Subst}\left (\int \frac{a-b-3 b x^2}{\left (-1+x^2\right ) \left (a-b+b x^2\right )^2} \, dx,x,\sec (e+f x)\right )}{2 a f}\\ &=-\frac{\cot (e+f x) \csc (e+f x)}{2 a f \left (a-b+b \sec ^2(e+f x)\right )}-\frac{b \sec (e+f x)}{a^2 f \left (a-b+b \sec ^2(e+f x)\right )}+\frac{\operatorname{Subst}\left (\int \frac{2 (a-2 b) (a-b)-4 (a-b) b x^2}{\left (-1+x^2\right ) \left (a-b+b x^2\right )} \, dx,x,\sec (e+f x)\right )}{4 a^2 (a-b) f}\\ &=-\frac{\cot (e+f x) \csc (e+f x)}{2 a f \left (a-b+b \sec ^2(e+f x)\right )}-\frac{b \sec (e+f x)}{a^2 f \left (a-b+b \sec ^2(e+f x)\right )}+\frac{(a-4 b) \operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{2 a^3 f}-\frac{((3 a-4 b) b) \operatorname{Subst}\left (\int \frac{1}{a-b+b x^2} \, dx,x,\sec (e+f x)\right )}{2 a^3 f}\\ &=-\frac{(3 a-4 b) \sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{2 a^3 \sqrt{a-b} f}-\frac{(a-4 b) \tanh ^{-1}(\cos (e+f x))}{2 a^3 f}-\frac{\cot (e+f x) \csc (e+f x)}{2 a f \left (a-b+b \sec ^2(e+f x)\right )}-\frac{b \sec (e+f x)}{a^2 f \left (a-b+b \sec ^2(e+f x)\right )}\\ \end{align*}

Mathematica [A]  time = 6.18172, size = 218, normalized size = 1.48 \[ \frac{-\frac{8 a b \cos (e+f x)}{(a-b) \cos (2 (e+f x))+a+b}+\frac{4 \sqrt{b} (3 a-4 b) \tan ^{-1}\left (\frac{\sqrt{a-b}-\sqrt{a} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{b}}\right )}{\sqrt{a-b}}+\frac{4 \sqrt{b} (3 a-4 b) \tan ^{-1}\left (\frac{\sqrt{a-b}+\sqrt{a} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{b}}\right )}{\sqrt{a-b}}+4 (a-4 b) \log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )-4 (a-4 b) \log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )-a \csc ^2\left (\frac{1}{2} (e+f x)\right )+a \sec ^2\left (\frac{1}{2} (e+f x)\right )}{8 a^3 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^3/(a + b*Tan[e + f*x]^2)^2,x]

[Out]

((4*(3*a - 4*b)*Sqrt[b]*ArcTan[(Sqrt[a - b] - Sqrt[a]*Tan[(e + f*x)/2])/Sqrt[b]])/Sqrt[a - b] + (4*(3*a - 4*b)
*Sqrt[b]*ArcTan[(Sqrt[a - b] + Sqrt[a]*Tan[(e + f*x)/2])/Sqrt[b]])/Sqrt[a - b] - (8*a*b*Cos[e + f*x])/(a + b +
 (a - b)*Cos[2*(e + f*x)]) - a*Csc[(e + f*x)/2]^2 - 4*(a - 4*b)*Log[Cos[(e + f*x)/2]] + 4*(a - 4*b)*Log[Sin[(e
 + f*x)/2]] + a*Sec[(e + f*x)/2]^2)/(8*a^3*f)

________________________________________________________________________________________

Maple [A]  time = 0.101, size = 229, normalized size = 1.6 \begin{align*}{\frac{1}{4\,f{a}^{2} \left ( \cos \left ( fx+e \right ) +1 \right ) }}-{\frac{\ln \left ( \cos \left ( fx+e \right ) +1 \right ) }{4\,f{a}^{2}}}+{\frac{\ln \left ( \cos \left ( fx+e \right ) +1 \right ) b}{f{a}^{3}}}-{\frac{b\cos \left ( fx+e \right ) }{2\,f{a}^{2} \left ( a \left ( \cos \left ( fx+e \right ) \right ) ^{2}- \left ( \cos \left ( fx+e \right ) \right ) ^{2}b+b \right ) }}+{\frac{3\,b}{2\,f{a}^{2}}\arctan \left ({ \left ( a-b \right ) \cos \left ( fx+e \right ){\frac{1}{\sqrt{b \left ( a-b \right ) }}}} \right ){\frac{1}{\sqrt{b \left ( a-b \right ) }}}}-2\,{\frac{{b}^{2}}{f{a}^{3}\sqrt{b \left ( a-b \right ) }}\arctan \left ({\frac{ \left ( a-b \right ) \cos \left ( fx+e \right ) }{\sqrt{b \left ( a-b \right ) }}} \right ) }+{\frac{1}{4\,f{a}^{2} \left ( \cos \left ( fx+e \right ) -1 \right ) }}+{\frac{\ln \left ( \cos \left ( fx+e \right ) -1 \right ) }{4\,f{a}^{2}}}-{\frac{\ln \left ( \cos \left ( fx+e \right ) -1 \right ) b}{f{a}^{3}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^3/(a+b*tan(f*x+e)^2)^2,x)

[Out]

1/4/f/a^2/(cos(f*x+e)+1)-1/4/f/a^2*ln(cos(f*x+e)+1)+1/f/a^3*ln(cos(f*x+e)+1)*b-1/2/f*b/a^2*cos(f*x+e)/(a*cos(f
*x+e)^2-cos(f*x+e)^2*b+b)+3/2/f*b/a^2/(b*(a-b))^(1/2)*arctan((a-b)*cos(f*x+e)/(b*(a-b))^(1/2))-2/f*b^2/a^3/(b*
(a-b))^(1/2)*arctan((a-b)*cos(f*x+e)/(b*(a-b))^(1/2))+1/4/f/a^2/(cos(f*x+e)-1)+1/4/f/a^2*ln(cos(f*x+e)-1)-1/f/
a^3*ln(cos(f*x+e)-1)*b

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^3/(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.52578, size = 1565, normalized size = 10.65 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^3/(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

[1/4*(2*(a^2 - 2*a*b)*cos(f*x + e)^3 + 4*a*b*cos(f*x + e) - ((3*a^2 - 7*a*b + 4*b^2)*cos(f*x + e)^4 - (3*a^2 -
 10*a*b + 8*b^2)*cos(f*x + e)^2 - 3*a*b + 4*b^2)*sqrt(-b/(a - b))*log(-((a - b)*cos(f*x + e)^2 - 2*(a - b)*sqr
t(-b/(a - b))*cos(f*x + e) - b)/((a - b)*cos(f*x + e)^2 + b)) - ((a^2 - 5*a*b + 4*b^2)*cos(f*x + e)^4 - (a^2 -
 6*a*b + 8*b^2)*cos(f*x + e)^2 - a*b + 4*b^2)*log(1/2*cos(f*x + e) + 1/2) + ((a^2 - 5*a*b + 4*b^2)*cos(f*x + e
)^4 - (a^2 - 6*a*b + 8*b^2)*cos(f*x + e)^2 - a*b + 4*b^2)*log(-1/2*cos(f*x + e) + 1/2))/((a^4 - a^3*b)*f*cos(f
*x + e)^4 - a^3*b*f - (a^4 - 2*a^3*b)*f*cos(f*x + e)^2), 1/4*(2*(a^2 - 2*a*b)*cos(f*x + e)^3 + 4*a*b*cos(f*x +
 e) - 2*((3*a^2 - 7*a*b + 4*b^2)*cos(f*x + e)^4 - (3*a^2 - 10*a*b + 8*b^2)*cos(f*x + e)^2 - 3*a*b + 4*b^2)*sqr
t(b/(a - b))*arctan(-(a - b)*sqrt(b/(a - b))*cos(f*x + e)/b) - ((a^2 - 5*a*b + 4*b^2)*cos(f*x + e)^4 - (a^2 -
6*a*b + 8*b^2)*cos(f*x + e)^2 - a*b + 4*b^2)*log(1/2*cos(f*x + e) + 1/2) + ((a^2 - 5*a*b + 4*b^2)*cos(f*x + e)
^4 - (a^2 - 6*a*b + 8*b^2)*cos(f*x + e)^2 - a*b + 4*b^2)*log(-1/2*cos(f*x + e) + 1/2))/((a^4 - a^3*b)*f*cos(f*
x + e)^4 - a^3*b*f - (a^4 - 2*a^3*b)*f*cos(f*x + e)^2)]

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**3/(a+b*tan(f*x+e)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.42445, size = 559, normalized size = 3.8 \begin{align*} \frac{\frac{6 \,{\left (a - 4 \, b\right )} \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}{a^{3}} - \frac{12 \,{\left (3 \, a b - 4 \, b^{2}\right )} \arctan \left (-\frac{a \cos \left (f x + e\right ) - b \cos \left (f x + e\right ) - b}{\sqrt{a b - b^{2}} \cos \left (f x + e\right ) + \sqrt{a b - b^{2}}}\right )}{\sqrt{a b - b^{2}} a^{3}} - \frac{3 \,{\left (\cos \left (f x + e\right ) - 1\right )}}{a^{2}{\left (\cos \left (f x + e\right ) + 1\right )}} + \frac{3 \, a^{2} + \frac{4 \, a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{28 \, a b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{16 \, b^{2}{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac{2 \, a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac{8 \, a b{\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}}{a^{3}{\left (\frac{a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{2 \, a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac{4 \, b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )}}}{24 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^3/(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/24*(6*(a - 4*b)*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1))/a^3 - 12*(3*a*b - 4*b^2)*arctan(-(a*cos(f*x + e)
 - b*cos(f*x + e) - b)/(sqrt(a*b - b^2)*cos(f*x + e) + sqrt(a*b - b^2)))/(sqrt(a*b - b^2)*a^3) - 3*(cos(f*x +
e) - 1)/(a^2*(cos(f*x + e) + 1)) + (3*a^2 + 4*a^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 28*a*b*(cos(f*x + e)
 - 1)/(cos(f*x + e) + 1) - a^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 16*b^2*(cos(f*x + e) - 1)^2/(cos(f*
x + e) + 1)^2 - 2*a^2*(cos(f*x + e) - 1)^3/(cos(f*x + e) + 1)^3 + 8*a*b*(cos(f*x + e) - 1)^3/(cos(f*x + e) + 1
)^3)/(a^3*(a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 2*a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 - 4*b*(cos(
f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + a*(cos(f*x + e) - 1)^3/(cos(f*x + e) + 1)^3)))/f